import logging
import os

from selenium.webdriver.chrome.options import Options

# 配置Selenium和WebDriver
chrome_options = Options()
chrome_options.binary_location = r"C:\Program Files\Google\Chrome\Application\chrome.exe"
chrome_options.headless = True  # 设置为无头模式，不显示浏览器界面
driver_path = "../resource/chromedriver.exe"  # 替换为你的ChromeDriver路径

# 文件下载地址
path = '../download/'
if not os.path.exists(path):
    os.makedirs(path)

# 请求伪装
headers = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36",
}

# 配置日志信息
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')

# 多线程配置
max_workers = 6
